Adding some more judges, here and there.
[andmenj-acm.git] / UVa / 11452 - Dancing the cheeky-cheeky / 11452.2.cpp
blob36a21828e88de8921fd3c43e94e48cea3ec475b0
1 /*
2 Accepted
3 */
4 #include <iostream>
6 using namespace std;
8 int main(){
9 int C;
10 string s;
11 cin >> C;
12 getline(cin, s);
13 while (C--){
14 getline(cin, s);
16 int n = s.size();
17 int i, j;
18 for (i=1; i<=n; ++i){
19 string first(s.substr(0, i)), second(s.substr(i, i));
20 if (first == second && n - 2*i < i){
21 //cout << "Solution found using first " << i << " chars." << endl;
22 break;
26 j = n - 2*i;
27 for (int k=0; k<8; ++k){
28 cout << s[j];
29 j = (j+1)%(2*i);
31 cout << "..." << endl;
33 return 0;